#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;
const int MOD = 1e8;
int n, m;
int a[15];
vector<int> cand;
int dp[15][1 << 12];
void init() {
  int mx = (1 << m) - 1;
  rep(i, 0, mx) {
    int j = i >> 1;
    if (!(i & j)) cand.push_back(i);
  }
}

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  init();
  rep(i, 1, n) rep(j, 0, m - 1) {
    int x;
    cin >> x;
    a[i] = a[i] * 2 + 1 - x;
  }

  dp[0][0] = 1;
  rep(i, 1, n + 1) {
    for (int u : cand) {
      if (a[i - 1] & u) continue;
      for (int v : cand) {
        if (a[i] & v) continue;
        if (u & v) continue;
        dp[i][v] = (dp[i][v] + dp[i - 1][u]) % MOD;
      }
    }
  }
  cout << dp[n + 1][0];
  return 0;
}